<?php
namespace Admin\Controller;
use Think\Controller;
class IndexController extends BaseController {
    public function index(){
    	$admin_name = cookie('admin_name');
    	// echo $admin_name;die;
    	$admin=M('admin')->where("admin_name='$admin_name'")->find();
    	$this->assign('admin',$admin);
        $this->display();
    }
    public function index_right(){
    	$limit=5;
		//查询数据总数
		$count=M('admin')->count();
        $product=M('product')->count();
        $art=M('article')->count();
        $pg=M('page')->count();
		//调用TP分页类
		$page=new \Think\Page($count,$limit);
		//生成分页
		$show=$page->show();
		$admin=M('admin')->limit($page->firstRow.','.$page->listRows)->select();
		$this->assign('show',$show);
		$this->assign('admin',$admin);
		$this->assign('a',$page->firstRow+1);
        $this->assign('product',$product);
        $this->assign('art',$art);
         $this->assign('pg',$pg);
        $this->display();
    }
}